﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using eTMS.Controllers;
using eTMS.Controllers.LopService;

namespace eTMS.Forms.Students
{
    public partial class FrmBaoLuuSinhVien : eTMS.Controls.BaseForm
    {
        public FrmBaoLuuSinhVien()
        {
            InitializeComponent();
        }

        private SinhVienController controller = new SinhVienController();
        public void SetController(SinhVienController svCtrl)
        {
            controller = svCtrl;
        }

        private void ucCommandDialog1_OnOK(object sender, CancelEventArgs e)
        {
            controller.SaveBaoLuuSinhVien((int)comboBoxHocKy1.SelectedValue, (int)comboBoxNamHoc1.SelectedValue, DateTime.Now.AddYears((int)Math.Round(txtThoiHan.Value)),searchSinhVien.GetSelectedSinhVienRows());
            ShowInfo(eTMS.Commons.Constants.MSS_SAVE_SUCCESS);

        }

        private void FrmBaoLuuSinhVien_Load(object sender, EventArgs e)
        {
            if (controller == null)
            {
                controller = new SinhVienController();
            }
            searchSinhVien.SetController(controller);
        }
    }
}
